import {TableColumnCtx} from "element-plus";
import DynamicTable3 from './index.vue'
import TableItem from './TableItem.vue'
import {ElTableColumn} from "element-plus/es/components/table";
import {TableTypes} from "./componentsConfig";

export type DynamicTable3InstanceType = InstanceType<typeof DynamicTable3>
export type TableItem3InstanceType = InstanceType<typeof TableItem>

export interface FormatterFirstParam {
  tableData: any[];
}

export type HiddenFunction = (item: TableConfigItem) => boolean;

export type TableConfigItem = {
  label: string;
  prop: string;
  hidden?: boolean | HiddenFunction;
  type?: 'selection' | 'index' | 'expand' | 'radio';
  /**
   * 不能使用type，因为elementUI已经使用，会出现错误
   */
  extendType?: TableTypes;
  minWidth?: string | number;
  width?: string | number;
  children?: TableConfigItem[];
  slotName?: string;
  fixed?: true | 'right' | 'left',
  formatter?: (firstParam: FormatterFirstParam, row, column: TableColumnCtx<any>, cellValue, index) => string;
} & InstanceType<typeof ElTableColumn>

export interface DefaultProps {
  row: object,
  column: TableColumnCtx<any>,
  $index: number,
}

export interface EventFirstParam extends DefaultProps {
  tableData: [];
  item: TableConfigItem,
}

export interface TableEventFirstParam {
  tableData: [];
  oldSelectChange: [];
  addSelect: [];
  removeSelect: [];
  notChangeSelect: [];
}

export type DisabledComFunc = (params: EventFirstParam) => boolean;













